<template>
    <Card >
        <div class="ivu-mb-8 library">
            <Select   placeholder="请选择公众号" v-model="params.wechatId" @on-change="changeWechat" clearable class="cur" v-width="280">
                <Option v-for="item in wechatList" :value="item.value" :key="item.value">{{ item.label }}</Option>
            </Select>
        </div>
        <template>
            <Tabs :value="active">
                <TabPane label="默认菜单" name="name1">
                    <consent ref="consent"></consent>
                </TabPane>
                <TabPane label="自定义菜单" name="name2">
                    <custom ref="custom"></custom>
                </TabPane>
            </Tabs>
        </template>
    </Card>
</template>
<script>
    import consent from './components/consent.vue'
    import custom from './components/custom.vue'
    import { wechatselectConfig } from '@api/public'
    export default {
        components: { consent, custom },
        data () {
            return {
                params: { wechatId: '' },
                wechatList: [],
                active: 'name1'
            }
        },
        mounted () {
            this.getwechat()
        },
        methods: {
            getwechat () {
                wechatselectConfig().then(res => {
                    this.wechatList = res
                })
            },
            changeWechat () {
                this.$refs.consent.initial(this.params.wechatId)
            }
        }
    }
</script>
<style scoped>

</style>
